//
//  main.m
//  1!+2!+3!+...+20!
//
//  Created by apple on 15/7/27.
//  Copyright (c) 2015年 戴维营. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
    //定义函数变量
    
        float n,s = 0,t = 1;
        for(n = 1;n <= 20;n++)
        {
            t *= n;
            s += t;
        }

        printf("1+2!+3!+...+20! = %e\n",s);
    }
    
    return 0;
}
